package com.efuture.io;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @ClassNAME PrintWriterTest
 * @Description PrintWriter的使用 基于字符的输出流
 * @Author zhaoshanshan
 * @Date 2021/9/8 8:50 下午
 * @Version 1.0
 */
public class PrintWriterTest {

    public static void main(String[] args) {
        PrintWriter pw = null;
        try {
            pw = new PrintWriter(new FileWriter("javasestudy/src/com.efuture.io/TestFileFive.txt"));
            pw.println("我是PrintWriter\n你会用吗?\n");
            pw.println("是不是学会了呢,小伙子");
            pw.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if(null!=pw){
                pw.close();
            }
        }

    }
}